package com.heima.article.job;

import com.heima.article.service.Impl.HotArticleServiceImpl;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ComputeHotArticleJob {

    @Autowired
    private HotArticleServiceImpl hotArticleService;

    /**
     * 计算热点文章
     */
    @XxlJob("computeHotArticleJob")
    public void computeHotArticle() {
        log.info("计算热点文章开始");
        hotArticleService.computeHotArticle();
        log.info("计算热点文章结束");
    }
}
